home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume90 / unix / uucp103d / part03 < prev    next >
Encoding:
Internet Message Format  |  1990-02-04  |  61.8 KB

  1. Path: xanth!cs.odu.edu!Amiga-Request
  2. From: Amiga-Request@cs.odu.edu (Amiga Sources/Binaries Moderator)
  3. Newsgroups: comp.sources.amiga
  4. Subject: v90i047: uucp 1.03D - unix compatible uucp/mail/news system, Part03/16
  5. Message-ID: <11274@xanth.cs.odu.edu>
  6. Date: 4 Feb 90 01:54:00 GMT
  7. Sender: tadguy@cs.odu.edu
  8. Reply-To: overload!dillon (Matt Dillon)
  9. Lines: 2424
  10. Approved: tadguy@cs.odu.edu (Tad Guy)
  11. X-Mail-Submissions-To: Amiga@cs.odu.edu
  12.  
  13. Submitted-by: overload!dillon (Matt Dillon)
  14. Posting-number: Volume 90, Issue 047
  15. Archive-name: unix/uucp-1.03d/part03
  16.  
  17. #!/bin/sh
  18. # This is a shell archive.  Remove anything before this line, then unpack
  19. # it by saving it into a file and typing "sh file".  To overwrite existing
  20. # files, type "sh file -c".  You can also feed this as standard input via
  21. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  22. # will see the following message at the end:
  23. #        "End of archive 3 (of 16)."
  24. # Contents:  MakeDist man/L.sys man/Passwd man/UUCP man/UUCico
  25. #   man/UUlog src/MUtil/from.c src/News060/Anews/raw.c
  26. #   src/News060/Anews/sendpacket.c src/dmail/README src/dmail/compat.c
  27. #   src/dmail/dmail.h src/dmail/help.c src/dmail/range.c
  28. #   src/dmail/set.c src/lib/lockfile.c src/lib/security.c
  29. #   src/lib/serialport.c src/uucico/includes.h src/uucico/uuxqt.c
  30. # Wrapped by tadguy@xanth on Sat Feb  3 20:51:02 1990
  31. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  32. if test -f 'MakeDist' -a "${1}" != "-c" ; then 
  33.   echo shar: Will not clobber existing file \"'MakeDist'\"
  34. else
  35. echo shar: Extracting \"'MakeDist'\" \(2213 characters\)
  36. sed "s/^X//" >'MakeDist' <<'END_OF_FILE'
  37. X
  38. Xfailat 25
  39. Xmakedir dist:uucp0
  40. Xmakedir dist:uucp0/man
  41. Xmakedir dist:uucp1
  42. Xmakedir dist:uucp1/c
  43. Xfailat 20
  44. X
  45. Xcopy #? dist:uucp0 CLONE
  46. X
  47. Xdupdate c dist:uucp0/c         FORCE
  48. Xdupdate lib dist:uucp0/lib   FORCE
  49. X
  50. Xfailat 25
  51. Xmakedir dist:uucp0/mail
  52. Xmakedir dist:uucp0/mail/news
  53. Xmakedir dist:uucp0/spool
  54. Xmakedir dist:uucp0/pub
  55. Xecho >dist:uucp0/mail/zoo-dummy
  56. Xecho >dist:uucp0/mail/news/zoo-dummy
  57. Xecho >dist:uucp0/spool/zoo-dummy
  58. Xecho >dist:uucp0/pub/zoo-dummy
  59. Xfailat 20
  60. X
  61. Xdelete dist:uucp0/lib/L.sys
  62. Xdelete dist:uucp0/lib/Passwd
  63. Xdelete dist:uucp0/lib/logfile
  64. Xdelete dist:uucp0/lib/Config
  65. Xdelete dist:uucp0/lib/Domain
  66. Xdelete dist:uucp0/lib/Aliases
  67. Xdelete dist:uucp0/lib/Getty-Header
  68. Xdelete dist:uucp0/lib/.signature
  69. Xdelete dist:uucp0/lib/.dmailrc
  70. Xrename dist:uucp0/lib/L.Sys.Sample dist:uucp0/lib/L.Sys
  71. Xrename dist:uucp0/lib/Passwd.Sample dist:uucp0/lib/Passwd
  72. Xrename dist:uucp0/lib/Config.sample dist:uucp0/lib/Config
  73. Xrename dist:uucp0/lib/Domain.sample dist:uucp0/lib/Domain
  74. Xrename dist:uucp0/lib/Aliases.sample dist:uucp0/lib/Aliases
  75. Xrename dist:uucp0/lib/Getty-Header.sample dist:uucp0/lib/Getty-header
  76. Xrename dist:uucp0/lib/.signature.sample dist:uucp0/lib/.signature
  77. Xrename dist:uucp0/lib/.dmailrc.sample dist:uucp0/lib/.dmailrc
  78. Xcopy man/dmail.help dist:uucp0/man
  79. X
  80. X;   Move aux executables out of boot floppy
  81. Xcopy dist:uucp0/c/uuencode dist:uucp1/c
  82. Xcopy dist:uucp0/c/uudecode dist:uucp1/c
  83. Xcopy dist:uucp0/c/tarsplit dist:uucp1/c
  84. Xcopy dist:uucp0/c/tar       dist:uucp1/c
  85. Xcopy dist:uucp0/c/man       dist:uucp1/c
  86. Xcopy dist:uucp0/c/uident   dist:uucp1/c
  87. Xcopy dist:uucp0/c/unshar   dist:uucp1/c
  88. Xcopy dist:uucp0/c/from       dist:uucp1/c
  89. Xcopy dist:uucp0/c/compress dist:uucp1/c
  90. Xdelete dist:uucp0/c/uuencode
  91. Xdelete dist:uucp0/c/uudecode
  92. Xdelete dist:uucp0/c/tarsplit
  93. Xdelete dist:uucp0/c/tar
  94. Xdelete dist:uucp0/c/man
  95. Xdelete dist:uucp0/c/uident
  96. Xdelete dist:uucp0/c/unshar
  97. Xdelete dist:uucp0/c/from
  98. Xdelete dist:uucp0/c/compress
  99. X
  100. X;   remainder of distribution.
  101. X
  102. Xdupdate devs dist:uucp0/devs FORCE
  103. Xdupdate system dist:uucp0/system FORCE
  104. Xdupdate libs dist:uucp0/libs FORCE
  105. Xdupdate man dist:uucp1/man   FORCE
  106. Xdupdate src dist:uucp1/src   FORCE
  107. Xdupdate l dist:uucp0/l         FORCE
  108. Xdupdate libs dist:uucp0/libs FORCE
  109. Xdupdate s dist:uucp0/s         FORCE
  110. X
  111. X
  112. X
  113. END_OF_FILE
  114. if test 2213 -ne `wc -c <'MakeDist'`; then
  115.     echo shar: \"'MakeDist'\" unpacked with wrong size!
  116. fi
  117. # end of 'MakeDist'
  118. fi
  119. if test -f 'man/L.sys' -a "${1}" != "-c" ; then 
  120.   echo shar: Will not clobber existing file \"'man/L.sys'\"
  121. else
  122. echo shar: Extracting \"'man/L.sys'\" \(2380 characters\)
  123. sed "s/^X//" >'man/L.sys' <<'END_OF_FILE'
  124. X
  125. XNAME
  126. X    UULIB:L.Sys
  127. X
  128. XDESCRIPTION
  129. X
  130. X    The L.Sys file is used by UUCico and sendmail (that is, Mail
  131. X    and DMail) to get information about one or more UUCP nodes
  132. X    that you can call.
  133. X
  134. X    An example L.Sys entry:
  135. X
  136. X                ------- (not part of the file)
  137. X
  138. X#   This is a comment.
  139. X
  140. XA500 Any SER: 9600 5551344 ogin: uover sword: qwee\r
  141. Xcae780 Any SER: 2400 5555667 ogin: Udillon sword: xarbge\r
  142. Xspooge Any SER: 2400 5551234 ogin: uucp sword: gugg\r
  143. Xsorinc Any SER: 2400 5551111 ogin: uover sword: bleg\r
  144. X#this is commented out.
  145. X#postgres Any SER: 9600 5556783 ogin: dillon sword: foobarb\r
  146. X
  147. X                ------- (not part of the file)
  148. X
  149. X    The first field is the name of the machine in question.
  150. X    CASE IS IMPORTANT.    Most machines use all lower-case names.
  151. X
  152. X    The second field is currently not used by AmigaUUCP but is
  153. X    reserved to indicate times we can call.
  154. X
  155. X    The third field is currently not used by AmigaUUCP but should
  156. X    remain SER: for future compatibility.  The SER: device is not
  157. X    actually used by UUCICO.
  158. X
  159. X    The fourth field is the call-out baud rate.  Call-in baud rates
  160. X    (that is, receiving a call) are determined by Getty.
  161. X
  162. X    The fifth field is the phone number to call to reach the
  163. X    machine in question.
  164. X
  165. X    Remaining fields are expect-send strings.  Once UUCico dials
  166. X    out and reaches the machine in question, it must login into that
  167. X    machine using the proper login and password.  The fields are
  168. X    always  expect send expect send expect send expect ... until the
  169. X    end of the line.  The expect field may be "" (two quote characters)
  170. X    to indicate we expect nothing and should immediately move to the
  171. X    next (send) field.
  172. X
  173. X    Special character sequences within a send field are recognized:
  174. X
  175. X    \b        send break.
  176. X    \r        write a carriage return
  177. X    \n        write a line feed
  178. X    \\        a backslash
  179. X    \t        a tab character
  180. X    \d        a 2 second delay occurs before further processing takes place
  181. X    \s        a space
  182. X    \c        Normally the send field is automatically terminated with
  183. X        a CR.  This DISABLES that.
  184. X
  185. X    As you will note by the above example, we usually do not have the
  186. X    first character of an expected string.  This is because the
  187. X    expect-send fields are case sensitive and some machines say
  188. X    'login:' while others say 'Login:'.
  189. X
  190. X    Refer to GETTY:Passwd (Man Passwd) on how to handle incomming calls.
  191. X
  192. XREFERENCES
  193. X
  194. X    L.Sys
  195. X    Passwd
  196. X
  197. END_OF_FILE
  198. if test 2380 -ne `wc -c <'man/L.sys'`; then
  199.     echo shar: \"'man/L.sys'\" unpacked with wrong size!
  200. fi
  201. # end of 'man/L.sys'
  202. fi
  203. if test -f 'man/Passwd' -a "${1}" != "-c" ; then 
  204.   echo shar: Will not clobber existing file \"'man/Passwd'\"
  205. else
  206. echo shar: Extracting \"'man/Passwd'\" \(2130 characters\)
  207. sed "s/^X//" >'man/Passwd' <<'END_OF_FILE'
  208. X
  209. XNAME
  210. X    GETTY:PASSWD
  211. X
  212. XSYNOPSIS
  213. X    -
  214. X
  215. XDESCRIPTION
  216. X    GETTY:PASSWD is similar to the UNIX /etc/passwd file and is
  217. X    currently used by Getty to verify remote logins and run the
  218. X    appropriate 'shell', which in most cases will be uucico.  The
  219. X    format is:
  220. X
  221. X    ------ start of GETTY:PASSWD -----
  222. X
  223. X    # Put any comment here
  224. X    #
  225. X    # User,Password,Uid,GroupId,Finger-Info,Home-Dir,Command-To-Run
  226. X
  227. X    bbs,*,10,0,BBS,ram:,mybbs:c/mybbs
  228. X    foo,bar,23,2,The Guy,ram:,uucp:c/uucico
  229. X    gaa,xxx,24,2,The Guy,ram:,uucp:c/uucico
  230. X
  231. X    ------ end of UUCP:LIB/PASSWD -------
  232. X
  233. X    The above example runs uucico when somebody logs in as 'foo'
  234. X    with the proper password (bar).  Normally the user runs a
  235. X    Getty from s:startup-sequence for each serial port he wishes
  236. X    to allow logins on.
  237. X
  238. X    The GETTY:PASSWD file combined with appropriate entries and
  239. X    a running Getty allow arbitrary UUCP connections to be made
  240. X    into your Amiga.
  241. X
  242. X    Sendmail will add your finger info to the From: field of any
  243. X    mail message.
  244. X
  245. XFIELDS
  246. X    User    =   user name, up to 8 characters
  247. X
  248. X    Password=   password, up to 8 characters (uncrypted for now)
  249. X            * = no password
  250. X
  251. X    Uid    =   unique numerical id (don't use 0 please), this WILL
  252. X            be used by some programs to find password entries.
  253. X            Give each entry a different UID.
  254. X
  255. X    Gid    =   not currently used, set to 2 (don't use 0).
  256. X
  257. X    Finger    =   Finger information (your name).  Future sub fields
  258. X            within the finger information will be separated by
  259. X            colons (:).
  260. X
  261. X    Home-Dir=   Directory from which to run the command
  262. X
  263. X    Command =   Command to run.  This command CANNOT BE A BCPL PROGRAM.
  264. X            Command is run with arguments you specify plus:
  265. X
  266. X            -DEVICE devicename -UNIT unitname
  267. X
  268. X            Where the devicename and unitname together make up
  269. X            a serial port which the command should use for further
  270. X            communications.  stdin and stdout are set to NULL:,
  271. X            as is the console handler.
  272. X
  273. X            (Getty accomplishes all of this)
  274. X
  275. X            If there is a '*' infront of the command name,
  276. X            then Getty will setup stdin and stdout using the
  277. X            UUSER: device, allowing programs to use stdio
  278. X            to talk to the serial device.
  279. X
  280. X            See UUSER.MAN
  281. X
  282. X
  283. X
  284. X
  285. END_OF_FILE
  286. if test 2130 -ne `wc -c <'man/Passwd'`; then
  287.     echo shar: \"'man/Passwd'\" unpacked with wrong size!
  288. fi
  289. # end of 'man/Passwd'
  290. fi
  291. if test -f 'man/UUCP' -a "${1}" != "-c" ; then 
  292.   echo shar: Will not clobber existing file \"'man/UUCP'\"
  293. else
  294. echo shar: Extracting \"'man/UUCP'\" \(2919 characters\)
  295. sed "s/^X//" >'man/UUCP' <<'END_OF_FILE'
  296. X
  297. XNAME
  298. X     uucp, uulog, uuname - unix to unix copy
  299. X
  300. XSYNTAX
  301. X     uucp [option...] source-file...  destination-file
  302. X
  303. X     uulog [option...]
  304. X
  305. X     uuname [option...]
  306. X
  307. XDESCRIPTION
  308. X     The uucp command copies files named by the source-file argu-
  309. X     ments to the destination-file argument.  A file name either
  310. X     may be a path name on your machine or may have the form
  311. X
  312. X          system-name!pathname
  313. X
  314. X     where `system-name' is taken from a list of system names
  315. X     which uucp knows about.  Shell metacharacters ?*[] appearing
  316. X     in the pathname part will be expanded on the appropriate
  317. X     system.
  318. X
  319. X     Pathnames may be a full pathname, a pathname preceded by
  320. X     ~user, where user is a userid on the specified system and is
  321. X     replaced by that user's login directory, or anything else
  322. X     prefixed by the current directory.
  323. X
  324. X     If the result is an erroneous pathname for the remote sys-
  325. X     tem, the copy will fail.  If the destination-file is a
  326. X     directory, the last part of the source-file name is used.
  327. X     If a simple ~user destination is inaccessible to uucp, data
  328. X     is copied to a spool directory and the user is notified by
  329. X     mail(1).
  330. X
  331. X     The uucp command preserves execute permissions across the
  332. X     transmission and gives 0666 read and write permissions.  For
  333. X     further information, see chmod(2).
  334. X
  335. XOPTIONS
  336. X     The following options are interpreted by uucp.
  337. X
  338. X     -d Creates all necessary directories for the file copy.
  339. X
  340. X     -c Uses the source file when copying out rather than copying
  341. X        the file to the spool directory.
  342. X
  343. X     -m Sends you mail to the requester when the copy is com-
  344. X        plete.
  345. X
  346. X     -W Expands only local files. Normally files names are
  347. X        prepended with the current working directory if a full
  348. X        path is not specified.  The -W tells uucp to expand local
  349. X        files only.
  350. X
  351. X     The uulog command prints a summary of uucp and uux transac-
  352. X     tions that were recorded in the file
  353. X     UUCP:spool/LOGFILE.
  354. X
  355. X     The options cause uulog to print logging information:
  356. X
  357. X     -ssys
  358. X        Displays information about work involving specified sys-
  359. X        tem.
  360. X
  361. X     -uuser
  362. X        Displays information about work involving specified user.
  363. X
  364. X     The uuname command lists the uucp names of known systems.
  365. X
  366. XWARNINGS
  367. X     The domain of remotely accessible files can (and for obvious
  368. X     security reasons, usually should) be severely restricted.
  369. X     You will very likely not be able to fetch files by pathname.
  370. X     Ask a responsible person on the remote system to send them
  371. X     to you.  For the same reasons, you will probably not be able
  372. X     to send files to arbitrary pathnames.
  373. X
  374. XRESTRICTIONS
  375. X     All files received by uucp will be owned by uucp.
  376. X     The -m option will only work sending files or receiving a
  377. X     single file.  (Receiving multiple files specified by special
  378. X     shell characters ?*[] will not activate the -m option.)
  379. X
  380. END_OF_FILE
  381. if test 2919 -ne `wc -c <'man/UUCP'`; then
  382.     echo shar: \"'man/UUCP'\" unpacked with wrong size!
  383. fi
  384. # end of 'man/UUCP'
  385. fi
  386. if test -f 'man/UUCico' -a "${1}" != "-c" ; then 
  387.   echo shar: Will not clobber existing file \"'man/UUCico'\"
  388. else
  389. echo shar: Extracting \"'man/UUCico'\" \(2893 characters\)
  390. sed "s/^X//" >'man/UUCico' <<'END_OF_FILE'
  391. X
  392. X
  393. XNAME
  394. X    UUCico
  395. X
  396. XSYNOPSIS
  397. X    UUCico -D[EVICE] device -U[NIT] unit -Getty -w -r1 -xn -o -[s/S]system -e
  398. X
  399. XDESCRIPTION
  400. X    UUCico is the basis for UUCP.    It can be run either from a
  401. X    GETTY when somebody logs into the Amiga, or it can be run
  402. X    from DCRON or manually to originate connections.
  403. X
  404. X    Some options to UUCico are now outdated and should not be
  405. X    used.  Specifically, earlier distributions did not have a
  406. X    GETTY and UUCICO had to deal with waiting for connections
  407. X    itself.
  408. X
  409. X    Either way, the final result is a connection between your
  410. X    machine and some remote machine.  UUCICO will retrieve any
  411. X    queued work on the remote machine and send any queued work on
  412. X    your machine.  These work files are located in UUCP:SPOOL.
  413. X
  414. X    The term 'work' refers to items queued by other programs,
  415. X    such as PNEWS and MAIL.  These programs create files in
  416. X    UUCP:SPOOL that inform UUCICO what to do with them and where
  417. X    to send them to.  On the flip side, when UUCICO receives a
  418. X    work file it will write it to UUCP:SPOOL then run UUXQT.
  419. X
  420. X    UUXQT scans received files and determines how to break them
  421. X    up (for example, append them to the appropriate mail box or
  422. X    news directory).  The control files in UUCP:SPOOL contain a
  423. X    line indicating the appropriate program required to unpack
  424. X    the files.  UUXQT reads this line and runs the proper
  425. X    unpacker (RMAIL, RNEWS, or CUNBATCH).
  426. X
  427. XGENERAL OPTIONS
  428. X
  429. X    (*)'d Options are supplied automatically on Getty Initiated
  430. X    connections
  431. X
  432. X   (*)  -D devicename       Default is serial.device
  433. X   (*)  -U unitnumber       Default is 0
  434. X    -xn            Set log level
  435. X
  436. XGETTY INITIATED OPTIONS
  437. X
  438. X   (*)  -Getty              Tells UUCICO that it was started from a Getty.
  439. X
  440. XMANUAL POLL OPTIONS
  441. X
  442. X    -ssystem        Poll (call-up) the specified system
  443. X    -Ssystem        Same as -s but ignore time restrictions
  444. X    -r1            Call all systems we have pending work for
  445. X
  446. XOBSOLETE OPTIONS    (WAIT MODE OPTIONS)  DO NOT USE IF YOU CAN HELP IT
  447. X
  448. X    -w            Tells UUCICO to wait for one or more
  449. X                connections (depending on -e) AFTER having
  450. X                previously polled one or more systems
  451. X                (-r, -s, -S).
  452. X
  453. X    -o            Tells UUCICO to not search for a CONNECT
  454. X                message when carrier is detected (hardwired
  455. X                configuration)
  456. X
  457. X    -e            Tells UUCICO to loop forever waiting for
  458. X                connections.
  459. X
  460. X    -n            FORCE WINDOW SIZE IN G PROTOCOL TO 1.
  461. X                Normally arbitrates 1 or 2.
  462. X
  463. X    <nooptions>        If UUCICO is run without either -Getty,
  464. X                -s, or -r, it will wait for a single
  465. X                connection.
  466. X
  467. XEXAMPLE
  468. X                -----
  469. X
  470. X    ; Place a line similar to this in your startup-sequence!
  471. X    ; See GETTY manual
  472. X
  473. X    resident uucp:C/Getty
  474. X    run <nil: >nil: Getty -A -B19200 -Mm
  475. X
  476. X                -----
  477. X
  478. X    ; Manually poll system 'foo'
  479. X    UUCico -sfoo
  480. X
  481. X                -----
  482. X
  483. X    ; From DCRON  (DCRON ENTRY)
  484. X40    1    *    *    *    uucp:c/uucico -r1
  485. X
  486. X
  487. X
  488. XFILES/REQUIRES
  489. X    UUCP:
  490. X    UUCP:c/*
  491. X    UUCP:lib/*
  492. X    UUCP:mail/
  493. X    UUCP:spool/
  494. X    UUCP:spool/LOGFILE
  495. X
  496. XREFERENCES
  497. X    manuals/Getty
  498. X    manuals/DCron
  499. X
  500. X
  501. X
  502. END_OF_FILE
  503. if test 2893 -ne `wc -c <'man/UUCico'`; then
  504.     echo shar: \"'man/UUCico'\" unpacked with wrong size!
  505. fi
  506. # end of 'man/UUCico'
  507. fi
  508. if test -f 'man/UUlog' -a "${1}" != "-c" ; then 
  509.   echo shar: Will not clobber existing file \"'man/UUlog'\"
  510. else
  511. echo shar: Extracting \"'man/UUlog'\" \(2919 characters\)
  512. sed "s/^X//" >'man/UUlog' <<'END_OF_FILE'
  513. X
  514. XNAME
  515. X     uucp, uulog, uuname - unix to unix copy
  516. X
  517. XSYNTAX
  518. X     uucp [option...] source-file...  destination-file
  519. X
  520. X     uulog [option...]
  521. X
  522. X     uuname [option...]
  523. X
  524. XDESCRIPTION
  525. X     The uucp command copies files named by the source-file argu-
  526. X     ments to the destination-file argument.  A file name either
  527. X     may be a path name on your machine or may have the form
  528. X
  529. X          system-name!pathname
  530. X
  531. X     where `system-name' is taken from a list of system names
  532. X     which uucp knows about.  Shell metacharacters ?*[] appearing
  533. X     in the pathname part will be expanded on the appropriate
  534. X     system.
  535. X
  536. X     Pathnames may be a full pathname, a pathname preceded by
  537. X     ~user, where user is a userid on the specified system and is
  538. X     replaced by that user's login directory, or anything else
  539. X     prefixed by the current directory.
  540. X
  541. X     If the result is an erroneous pathname for the remote sys-
  542. X     tem, the copy will fail.  If the destination-file is a
  543. X     directory, the last part of the source-file name is used.
  544. X     If a simple ~user destination is inaccessible to uucp, data
  545. X     is copied to a spool directory and the user is notified by
  546. X     mail(1).
  547. X
  548. X     The uucp command preserves execute permissions across the
  549. X     transmission and gives 0666 read and write permissions.  For
  550. X     further information, see chmod(2).
  551. X
  552. XOPTIONS
  553. X     The following options are interpreted by uucp.
  554. X
  555. X     -d Creates all necessary directories for the file copy.
  556. X
  557. X     -c Uses the source file when copying out rather than copying
  558. X        the file to the spool directory.
  559. X
  560. X     -m Sends you mail to the requester when the copy is com-
  561. X        plete.
  562. X
  563. X     -W Expands only local files. Normally files names are
  564. X        prepended with the current working directory if a full
  565. X        path is not specified.  The -W tells uucp to expand local
  566. X        files only.
  567. X
  568. X     The uulog command prints a summary of uucp and uux transac-
  569. X     tions that were recorded in the file
  570. X     UUCP:spool/LOGFILE.
  571. X
  572. X     The options cause uulog to print logging information:
  573. X
  574. X     -ssys
  575. X        Displays information about work involving specified sys-
  576. X        tem.
  577. X
  578. X     -uuser
  579. X        Displays information about work involving specified user.
  580. X
  581. X     The uuname command lists the uucp names of known systems.
  582. X
  583. XWARNINGS
  584. X     The domain of remotely accessible files can (and for obvious
  585. X     security reasons, usually should) be severely restricted.
  586. X     You will very likely not be able to fetch files by pathname.
  587. X     Ask a responsible person on the remote system to send them
  588. X     to you.  For the same reasons, you will probably not be able
  589. X     to send files to arbitrary pathnames.
  590. X
  591. XRESTRICTIONS
  592. X     All files received by uucp will be owned by uucp.
  593. X     The -m option will only work sending files or receiving a
  594. X     single file.  (Receiving multiple files specified by special
  595. X     shell characters ?*[] will not activate the -m option.)
  596. X
  597. END_OF_FILE
  598. if test 2919 -ne `wc -c <'man/UUlog'`; then
  599.     echo shar: \"'man/UUlog'\" unpacked with wrong size!
  600. fi
  601. # end of 'man/UUlog'
  602. fi
  603. if test -f 'src/MUtil/from.c' -a "${1}" != "-c" ; then 
  604.   echo shar: Will not clobber existing file \"'src/MUtil/from.c'\"
  605. else
  606. echo shar: Extracting \"'src/MUtil/from.c'\" \(2388 characters\)
  607. sed "s/^X//" >'src/MUtil/from.c' <<'END_OF_FILE'
  608. X
  609. X/*
  610. X *  FROM.C
  611. X *
  612. X *  FROM [user]
  613. X *
  614. X *  Displays From: and Subject fields, attempts to find personal name
  615. X *  in From: field.  If user not specified searches UULIB:Config
  616. X *  for UserName.
  617. X */
  618. X
  619. X#include <stdio.h>
  620. X#include <stdlib.h>
  621. X#include <config.h>
  622. X#include "/version.h"
  623. X
  624. XIDENT(".00");
  625. X
  626. Xvoid FromUser();
  627. Xchar *ExtractPersonalName();
  628. X
  629. Xvoid
  630. Xmain(ac, av)
  631. Xchar *av[];
  632. X{
  633. X    char haduser = 0;
  634. X    short i;
  635. X
  636. X    for (i = 1; i < ac; ++i) {
  637. X    if (av[i][0] != '-') {
  638. X        haduser = 1;
  639. X        FromUser(av[i]);
  640. X    }
  641. X    }
  642. X    if (haduser == 0) {
  643. X    char *user;
  644. X    if (user = FindConfig(USERNAME))
  645. X        FromUser(user);
  646. X    else
  647. X        printf("UULIB:Config, no 'UserName' entry!\n");
  648. X    }
  649. X}
  650. X
  651. Xvoid
  652. XFromUser(user)
  653. Xchar *user;
  654. X{
  655. X    static char Buf[256];
  656. X    static char FromLine[256];
  657. X    static char SubjLine[256];
  658. X    char *file = malloc(strlen(user) + 32);
  659. X    char *fromstr;
  660. X    FILE *fi;
  661. X
  662. X    sprintf(file, "UUMAIL:%s", user);
  663. X    if (fi = fopen(file, "r")) {
  664. X    while (fgets(Buf, 256, fi)) {
  665. X
  666. X        /*
  667. X         *    Start of message
  668. X         */
  669. X
  670. X        if (strncmp(Buf, "From ", 5) != 0)
  671. X        continue;
  672. X
  673. X        /*
  674. X         *    Scan headers for From: and Subject:
  675. X         *    Headers end with a blank line.
  676. X         */
  677. X
  678. X        FromLine[0] = 0;
  679. X        SubjLine[0] = '\n';
  680. X        SubjLine[1] = 0;
  681. X
  682. X        while (fgets(Buf, 256, fi) && Buf[0] != '\n') {
  683. X        if (strncmp(Buf, "From:", 5) == 0)
  684. X            strcpy(FromLine, Buf + 5);
  685. X        if (strncmp(Buf, "Subject:", 8) == 0)
  686. X            strcpy(SubjLine, Buf + 8);
  687. X        }
  688. X
  689. X        fromstr = ExtractPersonalName(FromLine);
  690. X        printf("%-20s %s", fromstr, SubjLine);
  691. X    }
  692. X    }
  693. X}
  694. X
  695. X/*
  696. X *  Search for (name) or name <addr> or <addr> name
  697. X */
  698. X
  699. Xchar *
  700. XExtractPersonalName(str)
  701. Xchar *str;
  702. X{
  703. X    char *p1, *p2;
  704. X    char sp = 1;
  705. X
  706. X    for (p1 = str; *p1; ++p1) {
  707. X    if (*p1 == '<') {
  708. X        if (sp == 0) {      /*  name before <addr>  */
  709. X        p2 = p1 - 1;
  710. X        p1 = str;
  711. X        break;
  712. X        }
  713. X                /*  name after <addr>    */
  714. X        while (*p1 && *p1 != '>')
  715. X        ++p1;
  716. X        if (*p1 == '>')
  717. X        ++p1;
  718. X        p2 = str + strlen(str) - 1;
  719. X        break;
  720. X    }
  721. X    if (*p1 == '(') {
  722. X        ++p1;
  723. X        for (p2 = p1; *p2 && *p2 != ')'; ++p2);
  724. X        if (*p2 == ')')
  725. X        --p2;
  726. X        break;
  727. X    }
  728. X    if (*p1 != ' ' && *p1 != 9)
  729. X        sp = 0;
  730. X    }
  731. X    if (*p1 == 0) { /*  could find a personal name! */
  732. X    p1 = str;
  733. X    p2 = str + strlen(str) - 1;
  734. X    }
  735. X    while (p2 >= p1 && (*p2 == '\n' || *p2 == ' ' || *p2 == 9))
  736. X    --p2;
  737. X    ++p2;
  738. X    if (p2 < p1)
  739. X    p2 = p1;
  740. X    *p2 = 0;
  741. X    return(p1);
  742. X}
  743. X
  744. END_OF_FILE
  745. if test 2388 -ne `wc -c <'src/MUtil/from.c'`; then
  746.     echo shar: \"'src/MUtil/from.c'\" unpacked with wrong size!
  747. fi
  748. # end of 'src/MUtil/from.c'
  749. fi
  750. if test -f 'src/News060/Anews/raw.c' -a "${1}" != "-c" ; then 
  751.   echo shar: Will not clobber existing file \"'src/News060/Anews/raw.c'\"
  752. else
  753. echo shar: Extracting \"'src/News060/Anews/raw.c'\" \(2229 characters\)
  754. sed "s/^X//" >'src/News060/Anews/raw.c' <<'END_OF_FILE'
  755. X
  756. X/*
  757. X *  RAW.C
  758. X *
  759. X *  This is a routine for setting a given stream to raw or cooked mode on the
  760. X *  Amiga . This is useful when you are using Lattice C to produce programs
  761. X *  that want to read single characters with the "getch()" or "fgetc" call.
  762. X *
  763. X *  Written : 18-Jun-87 By Chuck McManis.
  764. X */
  765. X
  766. X#include <exec/types.h>
  767. X#include <libraries/dos.h>
  768. X#include <libraries/dosextens.h>
  769. X#include <stdio.h>
  770. X
  771. X#include <ios1.h>
  772. X#include <error.h>
  773. X
  774. Xextern int    errno;        /* The error variable */
  775. X
  776. X/*
  777. X * Function raw() - Convert the specified file pointer to 'raw' mode. This
  778. X * only works on TTY's and essentially keeps DOS from translating keys for
  779. X * you, also (BIG WIN) it means getch() will return immediately rather than
  780. X * wait for a return. You lose editing features though.
  781. X */
  782. X
  783. Xlong
  784. Xraw(fp)
  785. XFILE *fp;
  786. X{
  787. X    struct MsgPort *mp;     /* The File Handle message port */
  788. X    struct FileHandle *afh;
  789. X    struct UFB       *ufb;
  790. X    long        Arg[1], res;
  791. X
  792. X    ufb = (struct UFB *) chkufb(fileno(fp));    /* Step one, get the file
  793. X                         * handle */
  794. X    afh = (struct FileHandle *) (ufb->ufbfh);
  795. X
  796. X    if (!IsInteractive(afh)) {  /* Step two, check to see if it's a console */
  797. X    errno = ENOTTY;
  798. X    return (-1);
  799. X    }
  800. X    /* Step three, get it's message port. */
  801. X    mp = ((struct FileHandle *) (BADDR(afh)))->fh_Type;
  802. X    Arg[0] = -1L;
  803. X    res = SendPacket(mp, ACTION_SCREEN_MODE, Arg, 1);   /* Put it in RAW: mode */
  804. X    if (res == 0) {
  805. X    errno = ENXIO;
  806. X    return (-1);
  807. X    }
  808. X    return (0);
  809. X}
  810. X
  811. X/*
  812. X * Function - cooked() this function returns the designate file pointer to
  813. X * it's normal, wait for a <CR> mode. This is exactly like raw() except that
  814. X * it sends a 0 to the console to make it back into a CON: from a RAW:
  815. X */
  816. X
  817. Xlong
  818. Xcooked(fp)
  819. XFILE *fp;
  820. X{
  821. X    struct MsgPort *mp;     /* The File Handle message port */
  822. X    struct FileHandle *afh;
  823. X    struct UFB       *ufb;
  824. X    long        Arg[1], res;
  825. X
  826. X    ufb = (struct UFB *) chkufb(fileno(fp));
  827. X    afh = (struct FileHandle *) (ufb->ufbfh);
  828. X    if (!IsInteractive(afh)) {
  829. X    errno = ENOTTY;
  830. X    return (-1);
  831. X    }
  832. X    mp = ((struct FileHandle *) (BADDR(afh)))->fh_Type;
  833. X    Arg[0] = 0;
  834. X    res = SendPacket(mp, ACTION_SCREEN_MODE, Arg, 1);
  835. X    if (res == 0) {
  836. X    errno = ENXIO;
  837. X    return (-1);
  838. X    }
  839. X    return (0);
  840. X}
  841. X
  842. X
  843. END_OF_FILE
  844. if test 2229 -ne `wc -c <'src/News060/Anews/raw.c'`; then
  845.     echo shar: \"'src/News060/Anews/raw.c'\" unpacked with wrong size!
  846. fi
  847. # end of 'src/News060/Anews/raw.c'
  848. fi
  849. if test -f 'src/News060/Anews/sendpacket.c' -a "${1}" != "-c" ; then 
  850.   echo shar: Will not clobber existing file \"'src/News060/Anews/sendpacket.c'\"
  851. else
  852. echo shar: Extracting \"'src/News060/Anews/sendpacket.c'\" \(2055 characters\)
  853. sed "s/^X//" >'src/News060/Anews/sendpacket.c' <<'END_OF_FILE'
  854. X
  855. X/*
  856. X * Sendpacket.c
  857. X *
  858. X * An invaluable addition to your Amiga.lib file. This code sends a packet the
  859. X * given message port. This makes working around DOS lots easier.
  860. X *
  861. X * Note, I didn't write this, those wonderful folks at CBM did. I do suggest
  862. X * however that you may wish to add it to Amiga.Lib, to do so, compile it and
  863. X * say 'oml lib:amiga.lib -r sendpacket.o'
  864. X */
  865. X
  866. X#include <exec/types.h>
  867. X#include <exec/ports.h>
  868. X#include <exec/memory.h>
  869. X#include <libraries/dos.h>
  870. X#include <libraries/dosextens.h>
  871. X
  872. X/*
  873. X * Function - SendPacket written by Phil Lindsay, Carolyn Scheppner, and Andy
  874. X * Finkel. This function will send a packet of the given type to the Message
  875. X * Port supplied.
  876. X */
  877. X
  878. Xlong
  879. XSendPacket(pid, action, args, nargs)
  880. X    struct MsgPort *pid;    /* process indentifier ... (handlers message
  881. X                 * port ) */
  882. X    long        action,    /* packet type ... (what you want handler to
  883. X                 * do )   */
  884. X            args[],    /* a pointer to a argument list */
  885. X            nargs;    /* number of arguments in list    */
  886. X{
  887. X    struct MsgPort *replyport;
  888. X    struct StandardPacket *packet;
  889. X
  890. X    long        count, *pargs, res1;
  891. X
  892. X    replyport = (struct MsgPort *) CreatePort(NULL, 0);
  893. X    if (!replyport)
  894. X    return (0);
  895. X
  896. X    /* Allocate space for a packet, make it public and clear it */
  897. X    packet = (struct StandardPacket *)
  898. X    AllocMem((long) sizeof(struct StandardPacket), MEMF_PUBLIC | MEMF_CLEAR);
  899. X    if (!packet) {
  900. X    DeletePort(replyport);
  901. X    return (0);
  902. X    }
  903. X    packet->sp_Msg.mn_Node.ln_Name = (char *) &(packet->sp_Pkt);
  904. X    packet->sp_Pkt.dp_Link = &(packet->sp_Msg);
  905. X    packet->sp_Pkt.dp_Port = replyport;
  906. X    packet->sp_Pkt.dp_Type = action;
  907. X
  908. X    /* copy the args into the packet */
  909. X    pargs = &(packet->sp_Pkt.dp_Arg1);  /* address of first argument */
  910. X    for (count = 0; count < nargs; count++)
  911. X    pargs[count] = args[count];
  912. X
  913. X    PutMsg(pid, packet);        /* send packet */
  914. X
  915. X    WaitPort(replyport);
  916. X    GetMsg(replyport);
  917. X
  918. X    res1 = packet->sp_Pkt.dp_Res1;
  919. X
  920. X    FreeMem(packet, (long) sizeof(struct StandardPacket));
  921. X    DeletePort(replyport);
  922. X
  923. X    return (res1);
  924. X}
  925. END_OF_FILE
  926. if test 2055 -ne `wc -c <'src/News060/Anews/sendpacket.c'`; then
  927.     echo shar: \"'src/News060/Anews/sendpacket.c'\" unpacked with wrong size!
  928. fi
  929. # end of 'src/News060/Anews/sendpacket.c'
  930. fi
  931. if test -f 'src/dmail/README' -a "${1}" != "-c" ; then 
  932.   echo shar: Will not clobber existing file \"'src/dmail/README'\"
  933. else
  934. echo shar: Extracting \"'src/dmail/README'\" \(3029 characters\)
  935. sed "s/^X//" >'src/dmail/README' <<'END_OF_FILE'
  936. X
  937. XREADME FILE FOR DMAIL v1.12 distribution June 1989
  938. X
  939. XRead Makefile for compiling and installation procedures. 
  940. X    
  941. XDmail compiles fine on UNIX BSD 4.2/4.3.  A man page exists and
  942. Xevery command as a full help page online from Dmail.
  943. X
  944. XAN EXAMPLE OF A .DMAILRC FILE: (happens to be mine)
  945. X---------------------------------------------------------------------------
  946. Xalias normal    "setlist -s 18 From 38 Subject 10 To 0 Cc 0 Date"
  947. Xalias from      "setlist -s 66 From; list; normal"
  948. Xalias me        "select To dillon , Cc dillon"
  949. Xalias bugs      "select To root staff manag , Cc staff manag root"
  950. Xalias trek      "select To trek , Cc trek"
  951. Xalias notme     "select -s To !dillon; resel -s Cc !dillon; resel From !dillon"
  952. Xalias hack      "select To hacker , Cc hacker"
  953. Xalias page      set page more
  954. Xalias nopage    unset page
  955. Xalias k         tag
  956. Xalias kn        "tag ; next"
  957. Xalias spool     "g /usr/spool/mail/dillon ~/Dmail/mbox"
  958. Xalias keep      "g ~/Dmail/keep"
  959. Xalias mbox      "g ~/Dmail/mbox"
  960. Xalias q         "select -s all; write ~/Dmail/keep -s tag; delete -s tag; quit"
  961. Xalias g         "select -s all; write ~/Dmail/keep -s tag; delete -s tag; qswi"
  962. Xset amiga       "decwrl!pyramid!amiga!support"
  963. Xset header      ~/.mailheader
  964. Xset ask
  965. Xnormal
  966. Xcd ~/Dmail
  967. X---------------------------------------------------------------------------
  968. X
  969. XIn the above example, I have created a Dmail directory to hold all my
  970. Xfolders.  Each folder will be a file containing multiple messages, fully
  971. Xcompatible with /usr/spool/ and mbox.
  972. X
  973. Xmy dmail alias is this:
  974. Xalias dmail '\dmail -O -l ~/Dmail/.dmailrc -o ~/Dmail/mbox -F Cc -F Date'
  975. X
  976. XNOTE: you don't need to alias dmail to anything.  without any arguments,
  977. Xit acts like /bin/Mail getting your mail from your spool, and placing 
  978. Xread mail on quit to mbox in your home directory.  I use -O so dmail
  979. Xgives me a command prompt even if there is no mail, and the -F options
  980. Xtell dmail to load those subjects into memory automatically (because I'm
  981. Xgoing to select on them immediately anyway).  If a field which you select
  982. Xon is not in memory, dmail must go to the mail file to find the field.
  983. XThis is transparent.
  984. X
  985. XGOOD LUCK!
  986. X---------------------------------------------- Another example of an .dmailrc
  987. Xif !comlinemail
  988. Xalias ls        "! ls"
  989. Xalias normal    "setlist -s 18 From 38 Subject 10 To 0 Cc 0 Date"
  990. Xalias news        "setlist -s 18 Newsgroup 30 Subject 10 Date 6 Lines 0 Keywords"
  991. Xalias hack        "select To hacker , Cc hacker"
  992. Xalias page        set page more
  993. Xalias nopage    unset page
  994. Xalias spool        "g /usr/spool/mail/dillon ~/Dmail/mbox"
  995. Xalias keep        "g ~/Dmail/keep"
  996. Xalias mbox        "g ~/Dmail/mbox"
  997. Xalias amiga        "select Resent-From: info , To: info , Cc: info
  998. Xalias g            "qswitch"
  999. Xalias kill        "%var sel Sub $var;d all;sel all"
  1000. Xset amiga        "decwrl!pyramid!amiga!support"
  1001. Xset header        ~/.mailheader
  1002. Xnormal
  1003. Xcd ~/Dmail
  1004. Xset archive        ~/Dmail/arch
  1005. Xendif
  1006. X-------------------------------------------------------------------
  1007. X
  1008. X                    -Matt
  1009. X
  1010. X                    dillon@ucb-vax.berkeley.edu
  1011. X                    ...!ucbvax!dillon
  1012. X
  1013. END_OF_FILE
  1014. if test 3029 -ne `wc -c <'src/dmail/README'`; then
  1015.     echo shar: \"'src/dmail/README'\" unpacked with wrong size!
  1016. fi
  1017. # end of 'src/dmail/README'
  1018. fi
  1019. if test -f 'src/dmail/compat.c' -a "${1}" != "-c" ; then 
  1020.   echo shar: Will not clobber existing file \"'src/dmail/compat.c'\"
  1021. else
  1022. echo shar: Extracting \"'src/dmail/compat.c'\" \(2344 characters\)
  1023. sed "s/^X//" >'src/dmail/compat.c' <<'END_OF_FILE'
  1024. X
  1025. X/*
  1026. X *  COMPAT.C
  1027. X *
  1028. X *  (C) Copyright 1985-1990 by Matthew Dillon,  All Rights Reserved.
  1029. X *
  1030. X */
  1031. X
  1032. X#include <stdio.h>
  1033. X#include <pwd.h>
  1034. X#include <sys/stat.h>
  1035. X#include "config.h"
  1036. X
  1037. X#ifdef AMIGA
  1038. X
  1039. Xextern char *gettmpenv();
  1040. Xextern char *getenv();
  1041. X
  1042. X#include <stdlib.h>
  1043. X#include <exec/types.h>
  1044. X#include <libraries/dos.h>
  1045. X#include <libraries/dosextens.h>
  1046. X
  1047. Xgetpid()
  1048. X{
  1049. X    return((long)FindTask(NULL));
  1050. X}
  1051. X
  1052. Xgetuid()
  1053. X{
  1054. X    return(0);
  1055. X}
  1056. X
  1057. Xstatic struct passwd pas;
  1058. X
  1059. Xstruct passwd *
  1060. Xgetpwuid()
  1061. X{
  1062. X    char *name = gettmpenv("USER");
  1063. X    if (name == NULL) {
  1064. X    name = FindConfig(USERNAME);
  1065. X    if (name == NULL) {
  1066. X        puts("Warning, USER enviroment variable not set!");
  1067. X        name = "root";
  1068. X    }
  1069. X    }
  1070. X    pas.pw_name = malloc(strlen(name) + 1);
  1071. X    pas.pw_dir    = malloc(16);
  1072. X    strcpy(pas.pw_name, name);
  1073. X    strcpy(pas.pw_dir, "sys:");
  1074. X    return(&pas);
  1075. X}
  1076. X
  1077. Xstruct passwd *
  1078. Xgetpwnam()
  1079. X{
  1080. X    return(getpwuid(0));
  1081. X}
  1082. X
  1083. Xvoid
  1084. Xbzero(d, n)
  1085. Xchar *d;
  1086. X{
  1087. X    setmem(d, n, 0);
  1088. X}
  1089. X
  1090. Xvoid
  1091. Xbcopy(s, d, n)
  1092. Xchar *s, *d;
  1093. X{
  1094. X    movmem(s, d, n);
  1095. X}
  1096. X
  1097. Xvoid
  1098. Xsleep(n)
  1099. X{
  1100. X    if (n)
  1101. X    Delay(50 * n);
  1102. X}
  1103. X
  1104. Xstat(file, st)
  1105. Xchar *file;
  1106. Xstruct stat *st;
  1107. X{
  1108. X    struct FileLock *lock;
  1109. X    struct FileInfoBlock *fib = (struct FileInfoBlock *)malloc(sizeof(struct FileInfoBlock));
  1110. X
  1111. X    lock = (struct FileLock *)Lock(file, SHARED_LOCK);
  1112. X    if (lock == NULL)
  1113. X    return(-1);
  1114. X    Examine((BPTR)lock, fib);
  1115. X    lock = (struct FileLock *)((long)lock << 2);
  1116. X    st->st_ino = lock->fl_Key;
  1117. X    st->st_ctime = st->st_mtime = fib->fib_Date.ds_Tick / 50 + fib->fib_Date.ds_Minute * 60 + fib->fib_Date.ds_Days * 86400;
  1118. X
  1119. X    lock = (struct FileLock *)((long)lock >> 2);
  1120. X    UnLock((BPTR)lock);
  1121. X    free(fib);
  1122. X    return(0);
  1123. X}
  1124. X
  1125. Xflock(fd, locktype)
  1126. X{
  1127. X    return(0);
  1128. X}
  1129. X
  1130. Xchar *
  1131. Xgettmpenv(id)
  1132. Xchar *id;
  1133. X{
  1134. X    static char *buf;
  1135. X    static char *res = NULL;
  1136. X    long fh;
  1137. X    long len;
  1138. X
  1139. X    buf = malloc(strlen(id) + 8);
  1140. X    sprintf(buf, "ENV:%s", id);
  1141. X    fh = Open(buf, 1005);
  1142. X    free(buf);
  1143. X    if (fh) {
  1144. X    Seek(fh, 0L, 1);
  1145. X    len = Seek(fh, 0L, -1);
  1146. X    if (len < 0) {
  1147. X        Close(fh);
  1148. X        return(NULL);
  1149. X    }
  1150. X    if (res)
  1151. X        free(res);
  1152. X    res = malloc(len + 1);
  1153. X    Read(fh, res, len);
  1154. X    Close(fh);
  1155. X    res[len] = 0;
  1156. X    return(res);
  1157. X    }
  1158. X    return(NULL);
  1159. X}
  1160. X
  1161. X
  1162. Xchar *
  1163. Xgetenv(id)
  1164. Xchar *id;
  1165. X{
  1166. X    char *res = gettmpenv(id);
  1167. X    char *perm = NULL;
  1168. X
  1169. X    if (res) {
  1170. X    perm = malloc(strlen(res) + 1);
  1171. X    strcpy(perm, res);
  1172. X    }
  1173. X    return(perm);
  1174. X}
  1175. X
  1176. X#endif
  1177. X
  1178. END_OF_FILE
  1179. if test 2344 -ne `wc -c <'src/dmail/compat.c'`; then
  1180.     echo shar: \"'src/dmail/compat.c'\" unpacked with wrong size!
  1181. fi
  1182. # end of 'src/dmail/compat.c'
  1183. fi
  1184. if test -f 'src/dmail/dmail.h' -a "${1}" != "-c" ; then 
  1185.   echo shar: Will not clobber existing file \"'src/dmail/dmail.h'\"
  1186. else
  1187. echo shar: Extracting \"'src/dmail/dmail.h'\" \(2605 characters\)
  1188. sed "s/^X//" >'src/dmail/dmail.h' <<'END_OF_FILE'
  1189. X
  1190. X/*
  1191. X * DMAIL.H
  1192. X *
  1193. X *  (C) Copyright 1985-1990 by Matthew Dillon,  All Rights Reserved.
  1194. X *
  1195. X */
  1196. X
  1197. X#define DVERSION     "Dmail Version 1.12,  June 1989"
  1198. X#define MAXTYPE      16     /* Max number of different fields remembered     */
  1199. X#define EXSTART      3        /* Beginning of dynamic fields, rest are wired   */
  1200. X#define MAXLIST      16     /* Maximum # list elements in SETLIST         */
  1201. X#define LONGSTACK    64     /* Maximum # levels for the longjump stack         */
  1202. X#define MAILMODE     0600   /* Standard mail mode for temp. files         */
  1203. X#define MAXFIELDSIZE 4096   /* Maximum handlable field size (& scratch bufs) */
  1204. X
  1205. X#define LEVEL_SET    0        /* which variable set to use             */
  1206. X#define LEVEL_ALIAS  1
  1207. X#define LEVEL_MALIAS 2
  1208. X
  1209. X#define R_INCLUDE   1        /* Include message        For DO_REPLY()  */
  1210. X#define R_FORWARD   2        /* Forward message        */
  1211. X#define R_REPLY     3        /* Reply to message     */
  1212. X#define R_MAIL        4        /* Mail from scratch    */
  1213. X
  1214. X#define M_RESET     0
  1215. X#define M_CONT        1
  1216. X
  1217. X
  1218. X#define PAGER(Puf)      _pager(Puf, 1)      /* Auto newline */
  1219. X#define FPAGER(Puf)     _pager(Puf, 0)      /* output as is */
  1220. X#define push_base()     (setjmp (env[1 + Longstack]) ? 1 : (++Longstack, 0))
  1221. X#define pop_base()      --Longstack
  1222. X#define push_break()    ++Breakstack
  1223. X#define pop_break()     --Breakstack
  1224. X
  1225. X#define ST_DELETED  0x0001  /* Status flag.. item has been deleted  */
  1226. X#define ST_READ     0x0002  /* item has been read or marked        */
  1227. X#define ST_STORED   0x0010  /* item has been written            */
  1228. X#define ST_TAG        0x0020  /* item has been taged            */
  1229. X#define ST_SCR        0x0080  /* scratch flag to single out messages  */
  1230. X
  1231. X#include <stdio.h>
  1232. X#include <setjmp.h>
  1233. X
  1234. Xstruct ENTRY {
  1235. X    long fpos;
  1236. X    int  no;
  1237. X    int  status;
  1238. X    char *from;
  1239. X    char *fields[MAXTYPE];
  1240. X};
  1241. X
  1242. Xstatic struct FIND {
  1243. X    char *search;
  1244. X    int  len;
  1245. X    int  notnew;
  1246. X    int  age;
  1247. X};
  1248. X
  1249. Xextern char *getenv(), *malloc(), *realloc(), *next_word(), *get_field();
  1250. Xextern char *alloca();
  1251. Xextern char *get_var();
  1252. X
  1253. Xextern char *mail_file;
  1254. Xextern char *user_name;
  1255. Xextern char *output_file;
  1256. Xextern char *home_dir;
  1257. Xextern char *visual;
  1258. Xextern char Buf[];
  1259. Xextern char Puf[];
  1260. Xextern char *av[], *Nulav[3];
  1261. Xextern int  Longstack, Breakstack;
  1262. Xextern int  XDebug;
  1263. Xextern int  Entries, Current;
  1264. Xextern int  Silence;
  1265. Xextern int  ac;
  1266. Xextern FILE *m_fi;
  1267. Xextern struct ENTRY *Entry;
  1268. Xextern struct FIND  Find[];
  1269. Xextern jmp_buf env[];
  1270. X
  1271. Xextern int width[], header[], Listsize;
  1272. Xextern int No_load_mail, XDisable, Did_cd;
  1273. X
  1274. Xextern char *S_sendmail;
  1275. Xextern int S_page, S_novibreak, S_verbose, S_ask, S_archive;
  1276. Xextern int lmessage_overide;
  1277. X
  1278. X
  1279. END_OF_FILE
  1280. if test 2605 -ne `wc -c <'src/dmail/dmail.h'`; then
  1281.     echo shar: \"'src/dmail/dmail.h'\" unpacked with wrong size!
  1282. fi
  1283. # end of 'src/dmail/dmail.h'
  1284. fi
  1285. if test -f 'src/dmail/help.c' -a "${1}" != "-c" ; then 
  1286.   echo shar: Will not clobber existing file \"'src/dmail/help.c'\"
  1287. else
  1288. echo shar: Extracting \"'src/dmail/help.c'\" \(2476 characters\)
  1289. sed "s/^X//" >'src/dmail/help.c' <<'END_OF_FILE'
  1290. X
  1291. X/*
  1292. X * HELP.C
  1293. X *
  1294. X *  (C) Copyright 1985-1990 by Matthew Dillon,  All Rights Reserved.
  1295. X *
  1296. X *  Global Routines:    DO_HELP()
  1297. X *
  1298. X */
  1299. X
  1300. X#include <stdio.h>
  1301. X#include "dmail.h"
  1302. X#include "execom.h"
  1303. X
  1304. X#ifdef AMIGA
  1305. X#define HELPFILE "MAN:dmail.help"
  1306. X#endif
  1307. X
  1308. X#ifndef HELPFILE
  1309. Xstatic char *help[] = {
  1310. X#include ".dmkout"
  1311. X};
  1312. X
  1313. Xdo_help()
  1314. X{
  1315. X    int i, j;
  1316. X    char *ptr;
  1317. X
  1318. X    if (push_base()) {
  1319. X    push_break();
  1320. X    pop_base();
  1321. X    PAGER (-1);
  1322. X    pop_break();
  1323. X    return;
  1324. X    }
  1325. X    PAGER (0);
  1326. X    if (ac == 1) {
  1327. X    for (j = 0; help[j] && *help[j] != '.'; ++j)
  1328. X        PAGER (help[j]);
  1329. X    for (i = 0; Command[i].name != NULL; ++i) {
  1330. X        if (*Command[i].name && !(Command[i].stat & C_NO)) {
  1331. X        if (Desc[i] == NULL)
  1332. X            puts("Software error, premature EOF in description table");
  1333. X        sprintf (Puf, "%-10s %s", Command[i].name, Desc[i]);
  1334. X        PAGER (Puf);
  1335. X        }
  1336. X    }
  1337. X    }
  1338. X    PAGER ("");
  1339. X    for (i = 1; i < ac; ++i) {
  1340. X    j = 0;
  1341. Xagain:
  1342. X    while (help[j]  &&  *help[j] != '.')
  1343. X        ++j;
  1344. X    if (help[j]) {
  1345. X        if (strncmp (av[i], help[j] + 1, strlen(av[i]))) {
  1346. X        ++j;
  1347. X        goto again;
  1348. X        }
  1349. X        while (help[j]  &&  *help[j] == '.')
  1350. X        ++j;
  1351. X        while (help[j]  &&  *help[j] != '.')
  1352. X        PAGER (help[j++]);
  1353. X        PAGER ("");
  1354. X        goto again;
  1355. X    }
  1356. X    }
  1357. X    PAGER (-1);
  1358. X    pop_base();
  1359. X}
  1360. X
  1361. X#else
  1362. X
  1363. Xdo_help()
  1364. X{
  1365. X    int i;
  1366. X    FILE *fi = NULL;
  1367. X    char *eof;
  1368. X
  1369. X    if (push_base()) {
  1370. X    push_break();
  1371. X    pop_base();
  1372. X    PAGER (-1);
  1373. X    if (fi != NULL) {
  1374. X        fclose (fi);
  1375. X        fi = NULL;
  1376. X    }
  1377. X    pop_break();
  1378. X    return (-1);
  1379. X    }
  1380. X    fi = fopen (HELPFILE, "r");
  1381. X    if (fi == NULL) {
  1382. X    printf ("Cannot open help file: %s\n", HELPFILE);
  1383. X    PAGER (-1);
  1384. X    pop_base();
  1385. X    return (-1);
  1386. X    }
  1387. X    PAGER (0);
  1388. X    if (ac == 1) {
  1389. X    while (fgets (Puf, MAXFIELDSIZE, fi)  &&  *Puf != '.')
  1390. X        FPAGER (Puf);
  1391. X    fclose (fi);
  1392. X    fi = NULL;
  1393. X    for (i = 0; Command[i].name != NULL; ++i) {
  1394. X        if (*Command[i].name) {
  1395. X        sprintf (Puf, "%-10s %s", Command[i].name, Desc[i]);
  1396. X        PAGER (Puf);
  1397. X        }
  1398. X    }
  1399. X    PAGER (-1);
  1400. X    pop_base();
  1401. X    return (1);
  1402. X    }
  1403. X    PAGER ("");
  1404. X    for (i = 1; i < ac; ++i) {
  1405. X    fseek (fi, 0, 0);
  1406. Xagain:
  1407. X    while ((eof = fgets (Puf, MAXFIELDSIZE, fi))  &&  *Puf != '.');
  1408. X    if (!eof)
  1409. X        continue;
  1410. X    if (strncmp (av[i], Puf + 1, strlen(av[i])))
  1411. X        goto again;
  1412. X    while ((eof = fgets (Puf, MAXFIELDSIZE, fi))  &&  *Puf == '.');
  1413. X    if (!eof)
  1414. X        continue;
  1415. X    FPAGER (Puf);
  1416. X    while ((eof = fgets (Puf, MAXFIELDSIZE, fi))  &&  *Puf != '.')
  1417. X        FPAGER (Puf);
  1418. X    PAGER ("");
  1419. X    if (!eof)
  1420. X        continue;
  1421. X    goto again;
  1422. X    }
  1423. X    fclose (fi);
  1424. X    fi = NULL;
  1425. X    PAGER (-1);
  1426. X    pop_base();
  1427. X}
  1428. X
  1429. X#endif
  1430. X
  1431. END_OF_FILE
  1432. if test 2476 -ne `wc -c <'src/dmail/help.c'`; then
  1433.     echo shar: \"'src/dmail/help.c'\" unpacked with wrong size!
  1434. fi
  1435. # end of 'src/dmail/help.c'
  1436. fi
  1437. if test -f 'src/dmail/range.c' -a "${1}" != "-c" ; then 
  1438.   echo shar: Will not clobber existing file \"'src/dmail/range.c'\"
  1439. else
  1440. echo shar: Extracting \"'src/dmail/range.c'\" \(3087 characters\)
  1441. sed "s/^X//" >'src/dmail/range.c' <<'END_OF_FILE'
  1442. X
  1443. X/*
  1444. X * RANGE.C
  1445. X *
  1446. X *  (C) Copyright 1985-1990 by Matthew Dillon,  All Rights Reserved.
  1447. X *
  1448. X *  Global Routines:    REWIND_RANGE()
  1449. X *            GET_RANGE()
  1450. X *            SINGLE_POSITION()
  1451. X *
  1452. X *  Static Routines:    None.
  1453. X *
  1454. X *
  1455. X */
  1456. X
  1457. X#include <stdio.h>
  1458. X#include "dmail.h"
  1459. X
  1460. X
  1461. Xstatic int range_ac;
  1462. Xstatic int in, start, end;
  1463. X
  1464. Xstruct RANOP {
  1465. X    char *name;
  1466. X    int status, kstatus;
  1467. X};
  1468. X
  1469. Xstatic struct RANOP Ranop[] = {
  1470. X    "all",  0,              0,
  1471. X    "tag",  ST_TAG,         ST_DELETED,
  1472. X    "wri",  ST_STORED,      ST_DELETED,
  1473. X    "del",  ST_DELETED,     0,
  1474. X    "mar",  ST_READ,        ST_DELETED,
  1475. X    "unt",  0,              ST_DELETED | ST_TAG,
  1476. X    "unw",  0,              ST_DELETED | ST_STORED,
  1477. X    "und",  0,              ST_DELETED,
  1478. X    "unm",  0,              ST_DELETED | ST_READ,
  1479. X    NULL ,  0,            0 };
  1480. X
  1481. Xvoid
  1482. Xrewind_range(beg)
  1483. X{
  1484. X    Silence = 0;
  1485. X    range_ac = beg;
  1486. X
  1487. X    if (range_ac >= ac) {
  1488. X    start = (Current >= 0) ? Entry[Current].no : 0;
  1489. X    end   = start;
  1490. X    in    = 1;
  1491. X    } else {
  1492. X    in    = 0;
  1493. X    }
  1494. X}
  1495. X
  1496. X
  1497. Xget_range()
  1498. X{
  1499. X    register char *ptr;
  1500. X    register int i;
  1501. X    static int status;        /* Status items required            */
  1502. X    static int kstatus;     /* Status items which cannot be present */
  1503. X
  1504. Xagain:
  1505. X    if (in  &&  start <= end) {
  1506. X    i = indexof(start++);
  1507. X    if (i < 0  || (Entry[i].status & status) != status ||
  1508. X        (Entry[i].status & kstatus))
  1509. X        goto again;
  1510. X    return (start - 1);
  1511. X    }
  1512. X    in = status = kstatus = 0;
  1513. X    if (range_ac >= ac)
  1514. X    return (0);
  1515. X    ptr = av[range_ac++];
  1516. X    if (*ptr == '-') {
  1517. X    if (xstrncmp (ptr, "-s", 2) == 0) {
  1518. X        Silence = 1;
  1519. X        goto again;
  1520. X    }
  1521. X    start = 1;
  1522. X    ++ptr;
  1523. X    goto dash;
  1524. X    }
  1525. X    if (*ptr < '0'  ||  *ptr > '9') {
  1526. X    start = 1;
  1527. X    end = 0;
  1528. X    for (i = 0; Ranop[i].name; ++i) {
  1529. X        if (xstrncmp (ptr, Ranop[i].name, 3) == 0) {
  1530. X        status = Ranop[i].status;
  1531. X        kstatus = Ranop[i].kstatus;
  1532. X        goto imprange;
  1533. X        }
  1534. X    }
  1535. X    goto again;
  1536. X    }
  1537. X    start = atoi(ptr);
  1538. X    while (*(++ptr)) {
  1539. X    if (*ptr == '-') {
  1540. X        ++ptr;
  1541. X        goto dash;
  1542. X    }
  1543. X    }
  1544. X    if (range_ac >= ac)
  1545. X    return (start);
  1546. X    if (*av[range_ac] == '-') {
  1547. X    ptr = av[range_ac++] + 1;
  1548. X    goto dash;
  1549. X    }
  1550. X    return (start);
  1551. Xdash:
  1552. X    if (*ptr) {
  1553. X    end = atoi(ptr);
  1554. X    goto imprange;
  1555. X    }
  1556. X    if (range_ac >= ac) {
  1557. X    end = 0;
  1558. X    goto imprange;
  1559. X    }
  1560. X    end = atoi(av[range_ac++]);
  1561. Ximprange:
  1562. X    if (end == 0) {
  1563. X    end = indexof (0);
  1564. X    if (end < 0)
  1565. X        return (0);
  1566. X    end = Entry[end].no;
  1567. X    }
  1568. X    if (start > end) {
  1569. X    printf ("Bad Range: %s\n", av[range_ac - 1]);
  1570. X    return (0);
  1571. X    }
  1572. X    in = 1;
  1573. X    goto again;
  1574. X}
  1575. X
  1576. X
  1577. Xsingle_position()
  1578. X{
  1579. X    int old = Current;
  1580. X
  1581. X    switch (ac) {
  1582. X    case 1:
  1583. X    break;
  1584. X    case 2:
  1585. X    if (*av[1] == '\0' || (*av[1] == ' ' && strlen(av[1]) == 1))
  1586. X        break;
  1587. X    Current = indexof (atoi(av[1]));
  1588. X    if (Current < 0) {
  1589. X        Current = old;
  1590. X        puts ("Out of Range, 0 will take you to the last entry");
  1591. X        return (-1);
  1592. X    }
  1593. X    break;
  1594. X    default:
  1595. X    puts ("Range not implemented (yet?)");
  1596. X    return (-1);
  1597. X    }
  1598. X    while (Current < Entries  &&  Entry[Current].no == 0)
  1599. X    ++Current;
  1600. X    if (Current >= Entries) {
  1601. X    Current = old;
  1602. X    puts ("No More Messages");
  1603. X    return (-1);
  1604. X    }
  1605. X    position_current();
  1606. X    return (1);
  1607. X}
  1608. X
  1609. X
  1610. END_OF_FILE
  1611. if test 3087 -ne `wc -c <'src/dmail/range.c'`; then
  1612.     echo shar: \"'src/dmail/range.c'\" unpacked with wrong size!
  1613. fi
  1614. # end of 'src/dmail/range.c'
  1615. fi
  1616. if test -f 'src/dmail/set.c' -a "${1}" != "-c" ; then 
  1617.   echo shar: Will not clobber existing file \"'src/dmail/set.c'\"
  1618. else
  1619. echo shar: Extracting \"'src/dmail/set.c'\" \(2727 characters\)
  1620. sed "s/^X//" >'src/dmail/set.c' <<'END_OF_FILE'
  1621. X
  1622. X/*
  1623. X *  SET.C
  1624. X *
  1625. X *  (C) Copyright 1985-1990 by Matthew Dillon,  All Rights Reserved.
  1626. X *
  1627. X *  Variable set/unset/get/reset routines
  1628. X *
  1629. X */
  1630. X
  1631. X
  1632. X#include <stdio.h>
  1633. X#include "dmail.h"
  1634. X#define MAXLEVELS 3
  1635. X
  1636. Xstruct MASTER {
  1637. X    struct MASTER *next;
  1638. X    struct MASTER *last;
  1639. X    char *name;
  1640. X    char *text;
  1641. X};
  1642. X
  1643. Xstruct MASTER *Mbase[MAXLEVELS];
  1644. X
  1645. Xvoid
  1646. Xset_var (level, name, str)
  1647. Xregister char *name, *str;
  1648. X{
  1649. X    register struct MASTER *base = Mbase[level];
  1650. X    register struct MASTER *last;
  1651. X
  1652. X    push_break();
  1653. X    while (base != NULL) {
  1654. X    if (strcmp (name, base->name) == 0) {
  1655. X        xfree (base->text);
  1656. X        goto gotit;
  1657. X    }
  1658. X    last = base;
  1659. X    base = base->next;
  1660. X    }
  1661. X    if (base == Mbase[level]) {
  1662. X    base = Mbase[level] = (struct MASTER *)malloc (sizeof (struct MASTER));
  1663. X    base->last = NULL;
  1664. X    } else {
  1665. X    base = (struct MASTER *)malloc (sizeof (struct MASTER));
  1666. X    base->last = last;
  1667. X    last->next = base;
  1668. X    }
  1669. X    base->name = malloc (strlen (name) + 1);
  1670. X    strcpy (base->name, name);
  1671. X    base->next = NULL;
  1672. Xgotit:
  1673. X    base->text    = malloc (strlen (str) + 1);
  1674. X    strcpy (base->text, str);
  1675. X    pop_break();
  1676. X}
  1677. X
  1678. X
  1679. Xunset_var(level, name, str)
  1680. Xregister char *name, *str;
  1681. X{
  1682. X    register struct MASTER *base = Mbase[level];
  1683. X    register struct MASTER *last = NULL;
  1684. X
  1685. X    push_break();
  1686. X    while (base != NULL) {
  1687. X    if (strcmp (name, base->name) == 0) {
  1688. X        if (base != Mbase[level])
  1689. X        last->next = base->next;
  1690. X        else
  1691. X        Mbase[level] = base->next;
  1692. X        if (base->next != NULL)
  1693. X        base->next->last = last;
  1694. X        if (base == Mbase[level])
  1695. X        Mbase[level] = base->next;
  1696. X        xfree (base->name);
  1697. X        xfree (base->text);
  1698. X        xfree (base);
  1699. X        pop_break();
  1700. X        return (1);
  1701. X    }
  1702. X    last = base;
  1703. X    base = base->next;
  1704. X    }
  1705. X    pop_break();
  1706. X    return (-1);
  1707. X}
  1708. X
  1709. X
  1710. Xchar *
  1711. Xget_var(level, name)
  1712. Xregister char *name;
  1713. X{
  1714. X    register struct MASTER *base = Mbase[level];
  1715. X
  1716. X    while (base != NULL) {
  1717. X    if (strcmp (name, base->name) == 0)
  1718. X        return (base->text);
  1719. X    base = base->next;
  1720. X    }
  1721. X    return (NULL);
  1722. X}
  1723. X
  1724. X
  1725. Xdo_unset_var(str, level)
  1726. Xchar *str;
  1727. X{
  1728. X    int i;
  1729. X
  1730. X    push_break();
  1731. X    for (i = 1; i < ac; ++i)
  1732. X    unset_var (level, av[i]);
  1733. X    fix_globals();
  1734. X    pop_break();
  1735. X    return (1);
  1736. X}
  1737. X
  1738. Xvoid
  1739. Xdo_set_var(command, level)
  1740. Xchar *command;
  1741. X{
  1742. X    register struct MASTER *base = Mbase[level];
  1743. X    register char *str;
  1744. X
  1745. X    if (ac == 1) {
  1746. X    while (base) {
  1747. X        printf ("%-10s %s\n", base->name, base->text);
  1748. X        base = base->next;
  1749. X    }
  1750. X    }
  1751. X    if (ac == 2) {
  1752. X    str = get_var (level, av[1]);
  1753. X    if (str) {
  1754. X        printf ("%-10s %s\n", av[1], str);
  1755. X    } else {
  1756. X        push_break();
  1757. X        set_var (level, av[1], "");
  1758. X        fix_globals();
  1759. X        pop_break();
  1760. X    }
  1761. X    }
  1762. X    if (ac > 2) {
  1763. X    push_break();
  1764. X    set_var (level, av[1], next_word (next_word (command)));
  1765. X    fix_globals();
  1766. X    pop_break();
  1767. X    }
  1768. X}
  1769. X
  1770. X
  1771. X
  1772. END_OF_FILE
  1773. if test 2727 -ne `wc -c <'src/dmail/set.c'`; then
  1774.     echo shar: \"'src/dmail/set.c'\" unpacked with wrong size!
  1775. fi
  1776. # end of 'src/dmail/set.c'
  1777. fi
  1778. if test -f 'src/lib/lockfile.c' -a "${1}" != "-c" ; then 
  1779.   echo shar: Will not clobber existing file \"'src/lib/lockfile.c'\"
  1780. else
  1781. echo shar: Extracting \"'src/lib/lockfile.c'\" \(2345 characters\)
  1782. sed "s/^X//" >'src/lib/lockfile.c' <<'END_OF_FILE'
  1783. X
  1784. X/*
  1785. X *  LOCKFILE.C
  1786. X *
  1787. X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
  1788. X *
  1789. X *  Lock and unlock a file.  Under AmigaDOS, openning a file mode 1006
  1790. X *  (accomplished with fopen(,"w"), locks the file exclusively.  That
  1791. X *  is, further fopen()s will fail.  Thus, we need only keep a live
  1792. X *  file descriptor to 'lock' the file.
  1793. X *
  1794. X *  This is advantagious because if the program exits without removing
  1795. X *  the lock file we are still ok... the file is unlocked by virtue of
  1796. X *  the file descriptor getting closed.
  1797. X */
  1798. X
  1799. X#include <exec/types.h>
  1800. X#include <exec/lists.h>
  1801. X#include <proto/all.h>
  1802. X#include <stdio.h>
  1803. X#include <stdlib.h>
  1804. X
  1805. Xtypedef struct List LIST;
  1806. Xtypedef struct Node NODE;
  1807. X
  1808. Xtypedef struct {
  1809. X    NODE    Node;
  1810. X    FILE    *Fi;
  1811. X    short   Refs;
  1812. X} LNode;
  1813. X
  1814. XLIST LockList = { (NODE *)&LockList.lh_Tail, NULL, (NODE *)&LockList.lh_Head };
  1815. X
  1816. Xvoid FreeLockNode();
  1817. X
  1818. Xvoid
  1819. XLockFile(file)
  1820. Xchar *file;
  1821. X{
  1822. X    char *ptr;
  1823. X
  1824. X    LNode *node;
  1825. X    LNode *n;
  1826. X
  1827. X    for (ptr = file + strlen(file); ptr >= file && *ptr != '/' && *ptr != ':'; --ptr);
  1828. X    ++ptr;
  1829. X
  1830. X
  1831. X    if (node = malloc(sizeof(LNode) + strlen(ptr) + 16)) {
  1832. X    node->Node.ln_Name = (char *)(node + 1);
  1833. X    sprintf(node->Node.ln_Name, "T:%s.LOCK", ptr);
  1834. X
  1835. X    for (n = (LNode *)LockList.lh_Head; n != (LNode *)&LockList.lh_Tail; n = (LNode *)n->Node.ln_Succ) {
  1836. X        if (strcmp(node->Node.ln_Name, n->Node.ln_Name) == 0) {
  1837. X        ++n->Refs;
  1838. X        free(node);
  1839. X        return;
  1840. X        }
  1841. X    }
  1842. X
  1843. X    while ((node->Fi = fopen(node->Node.ln_Name, "w")) == NULL) {
  1844. X        sleep(2);
  1845. X        chkabort();
  1846. X    }
  1847. X    node->Refs = 1;
  1848. X    AddTail(&LockList, &node->Node);
  1849. X    }
  1850. X}
  1851. X
  1852. Xvoid
  1853. XUnLockFile(file)
  1854. Xchar *file;
  1855. X{
  1856. X    LNode *node;
  1857. X    short len;
  1858. X    char *ptr;
  1859. X
  1860. X    for (ptr = file + strlen(file); ptr >= file && *ptr != '/' && *ptr != ':'; --ptr);
  1861. X    ++ptr;
  1862. X    len = strlen(ptr);
  1863. X
  1864. X    for (node = (LNode *)LockList.lh_Head; node != (LNode *)&LockList.lh_Tail; node = (LNode *)node->Node.ln_Succ) {
  1865. X    if (strncmp(ptr, node->Node.ln_Name + 2, len) == 0 && strlen(node->Node.ln_Name) == len + 7) {
  1866. X        if (--node->Refs == 0)
  1867. X        FreeLockNode(node);
  1868. X        return;
  1869. X    }
  1870. X    }
  1871. X}
  1872. X
  1873. Xvoid
  1874. XUnLockFiles()
  1875. X{
  1876. X    LNode *node;
  1877. X
  1878. X    while ((node = (LNode *)LockList.lh_Head) != (LNode *)&LockList.lh_Tail)
  1879. X    FreeLockNode(node);
  1880. X}
  1881. X
  1882. Xvoid
  1883. XFreeLockNode(node)
  1884. XLNode *node;
  1885. X{
  1886. X    Remove(node);
  1887. X    fclose(node->Fi);
  1888. X    unlink(node->Node.ln_Name);
  1889. X    free(node);
  1890. X}
  1891. X
  1892. END_OF_FILE
  1893. if test 2345 -ne `wc -c <'src/lib/lockfile.c'`; then
  1894.     echo shar: \"'src/lib/lockfile.c'\" unpacked with wrong size!
  1895. fi
  1896. # end of 'src/lib/lockfile.c'
  1897. fi
  1898. if test -f 'src/lib/security.c' -a "${1}" != "-c" ; then 
  1899.   echo shar: Will not clobber existing file \"'src/lib/security.c'\"
  1900. else
  1901. echo shar: Extracting \"'src/lib/security.c'\" \(2279 characters\)
  1902. sed "s/^X//" >'src/lib/security.c' <<'END_OF_FILE'
  1903. X
  1904. X/*
  1905. X *  SECURITY.C
  1906. X *
  1907. X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
  1908. X *
  1909. X *  Checks whether a given file should be allowed to be read or written
  1910. X *
  1911. X *  Lock directory containing file
  1912. X *  Generate directory path
  1913. X *  Check path against allowed list (UULIB:Security)
  1914. X *
  1915. X *  If type == 'c' return  1 if file name begins with a C.
  1916. X *           return -1 if file name does not begin with a C.
  1917. X *           return  0 if file name begins with a C. but is for
  1918. X *            a directory other than the current one.
  1919. X */
  1920. X
  1921. X#include <proto/all.h>
  1922. X#include <libraries/dosextens.h>
  1923. X#include <stdio.h>
  1924. X
  1925. Xtypedef struct FileLock FileLock;
  1926. X
  1927. Xstatic char TmpBuf[128];
  1928. X
  1929. XSecurityDisallow(file, type)
  1930. Xchar *file;
  1931. X{
  1932. X    char *fs;
  1933. X    char c;
  1934. X    int  disallow = 1;
  1935. X    BPTR lock;
  1936. X    BPTR slock;
  1937. X
  1938. X    for (fs = file + strlen(file); fs >= file && *fs != '/' && *fs != ':'; --fs);
  1939. X    ++fs;
  1940. X    if (fs == file) {           /*  just a file name    */
  1941. X    if (type == 'c') {
  1942. X        if ((file[0]|0x20) == 'c' && file[1] == '.')
  1943. X        return(1);
  1944. X        return(-1);
  1945. X    }
  1946. X    return(0);              /*  type r or w, current dir, allow. */
  1947. X    }
  1948. X    if (type == 'c')            /*  not just a file name, allow C.   */
  1949. X    return(0);
  1950. X    c = *fs;
  1951. X    *fs = 0;        /*  keep just the path        */
  1952. X
  1953. X    lock = Lock(file, SHARED_LOCK);
  1954. X    if (lock) {
  1955. X    FILE *fi = fopen("UULIB:Security", "r");
  1956. X    if (fi) {
  1957. X        while (fgets(TmpBuf, sizeof(TmpBuf), fi)) {
  1958. X        char *ptr;
  1959. X        if (TmpBuf[0] == '#' || TmpBuf[0] == '\n' || TmpBuf[0] == 0)
  1960. X            continue;
  1961. X
  1962. X        /*
  1963. X         *  breakout the directory name and permissions
  1964. X         */
  1965. X
  1966. X        for (ptr = TmpBuf; *ptr != '\n' && *ptr != ' ' && *ptr != 9; ++ptr);
  1967. X        *ptr = 0;
  1968. X
  1969. X        /*
  1970. X         *  permissions allowed?
  1971. X         */
  1972. X
  1973. X        for (++ptr; *ptr && *ptr != type; ++ptr);
  1974. X        if (*ptr == 0)      /*  sorry   */
  1975. X            continue;
  1976. X
  1977. X        if (slock = Lock(TmpBuf, SHARED_LOCK)) {
  1978. X            if (SameLock(lock, slock))
  1979. X            disallow = 0;
  1980. X            UnLock(slock);
  1981. X        }
  1982. X        if (disallow == 0)
  1983. X            break;
  1984. X        }
  1985. X        fclose(fi);
  1986. X    }
  1987. X    UnLock(lock);
  1988. X    }
  1989. X
  1990. X    *fs = c;        /*  restore path    */
  1991. X
  1992. X    return(disallow);
  1993. X}
  1994. X
  1995. XSameLock(lock, slock)
  1996. XBPTR lock, slock;
  1997. X{
  1998. X    FileLock *fl1 = (FileLock *)((long)lock << 2);
  1999. X    FileLock *fl2 = (FileLock *)((long)slock << 2);
  2000. X
  2001. X    if (fl1->fl_Task == fl2->fl_Task && fl1->fl_Key == fl2->fl_Key)
  2002. X    return(1);
  2003. X    return(0);
  2004. X}
  2005. X
  2006. END_OF_FILE
  2007. if test 2279 -ne `wc -c <'src/lib/security.c'`; then
  2008.     echo shar: \"'src/lib/security.c'\" unpacked with wrong size!
  2009. fi
  2010. # end of 'src/lib/security.c'
  2011. fi
  2012. if test -f 'src/lib/serialport.c' -a "${1}" != "-c" ; then 
  2013.   echo shar: Will not clobber existing file \"'src/lib/serialport.c'\"
  2014. else
  2015. echo shar: Extracting \"'src/lib/serialport.c'\" \(2562 characters\)
  2016. sed "s/^X//" >'src/lib/serialport.c' <<'END_OF_FILE'
  2017. X
  2018. X/*
  2019. X *  SERIALPORT.C
  2020. X *
  2021. X *  (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
  2022. X *
  2023. X *  Serial Port locking to prevent collisions between, say, a Getty
  2024. X *  accepting a login sequence and a uucico calling up another machine.
  2025. X *
  2026. X *  The existance of the public port indicates a lock.    People waiting
  2027. X *  for the lock PutMsg() EXEC messages to the port.  Upon unlocking,
  2028. X *  the unlocker will deallocate the port only if no messages are
  2029. X *  pending, else it will ReplyMsg() the first message in the queue
  2030. X *  and NOT deallocate the port.
  2031. X *
  2032. X *  On receiving a message back you own the port and its memory
  2033. X */
  2034. X
  2035. X#include <proto/all.h>
  2036. X#include <exec/memory.h>
  2037. X
  2038. Xtypedef struct MsgPort    PORT;
  2039. Xtypedef struct Message    MSG;
  2040. X
  2041. Xstruct SMsgPort {
  2042. X    PORT    Port;
  2043. X    short   NameLen;
  2044. X    short   Reserved;
  2045. X};
  2046. X
  2047. Xtypedef struct SMsgPort SPORT;
  2048. X
  2049. Xstatic SPORT    *SPLock;
  2050. X
  2051. Xint IAmGetty = 0;
  2052. X
  2053. Xvoid
  2054. XLockSerialPort(name, unit)
  2055. Xchar *name;
  2056. Xlong unit;
  2057. X{
  2058. X    short namelen = strlen(name) + 32;
  2059. X    char *portname;
  2060. X    SPORT *sport;
  2061. X    PORT  *rport = NULL;
  2062. X    MSG   msg;
  2063. X
  2064. X    if (SPLock)
  2065. X    return;
  2066. X
  2067. X    portname = AllocMem(namelen, MEMF_PUBLIC | MEMF_CLEAR);
  2068. X
  2069. X    sprintf(portname, "SPLock-%d-%s", unit, name);
  2070. X
  2071. X    Forbid();
  2072. X    if (sport = (SPORT *)FindPort(portname)) {
  2073. X    rport = CreatePort(NULL, 0);
  2074. X    msg.mn_ReplyPort = rport;
  2075. X    msg.mn_Length = 0;
  2076. X    if (IAmGetty)
  2077. X        AddHead(&sport->Port.mp_MsgList, &msg);
  2078. X    else
  2079. X        AddTail(&sport->Port.mp_MsgList, &msg);
  2080. X    FreeMem(portname, namelen);
  2081. X    } else {
  2082. X    sport = AllocMem(sizeof(SPORT), MEMF_PUBLIC | MEMF_CLEAR);
  2083. X    sport->Port.mp_Node.ln_Name = portname;
  2084. X    sport->Port.mp_Node.ln_Type = NT_MSGPORT;
  2085. X    sport->Port.mp_Flags = PA_IGNORE;
  2086. X    sport->NameLen = namelen;
  2087. X    AddPort(&sport->Port);
  2088. X    }
  2089. X    Permit();
  2090. X    SPLock = sport;
  2091. X    if (rport) {            /*  wait for message to be returned */
  2092. X    WaitPort(rport);
  2093. X    DeletePort(rport);
  2094. X    }
  2095. X}
  2096. X
  2097. X/*
  2098. X *  Unlock the serial port.  If I am NOT the Getty then delay before
  2099. X *  unlocking to give the Getty a chance to take the next lock (it takes
  2100. X *  about a second for the Getty to realize the serial.device has been
  2101. X *  closed and try to take the lock.
  2102. X */
  2103. X
  2104. Xvoid
  2105. XUnLockSerialPort(name, unit)
  2106. Xchar *name;
  2107. Xlong unit;
  2108. X{
  2109. X    MSG *msg;
  2110. X
  2111. X    if (SPLock) {
  2112. X    if (IAmGetty == 0)
  2113. X        sleep(2);
  2114. X    Forbid();
  2115. X    if (msg = GetMsg(&SPLock->Port)) {  /*  somebody else wants it */
  2116. X        ReplyMsg(msg);
  2117. X    } else {            /*  nobody else wants it   */
  2118. X        RemPort(&SPLock->Port);
  2119. X        FreeMem(SPLock->Port.mp_Node.ln_Name, SPLock->NameLen);
  2120. X        FreeMem(SPLock, sizeof(SPORT));
  2121. X    }
  2122. X    Permit();
  2123. X    SPLock = NULL;
  2124. X    }
  2125. X}
  2126. X
  2127. END_OF_FILE
  2128. if test 2562 -ne `wc -c <'src/lib/serialport.c'`; then
  2129.     echo shar: \"'src/lib/serialport.c'\" unpacked with wrong size!
  2130. fi
  2131. # end of 'src/lib/serialport.c'
  2132. fi
  2133. if test -f 'src/uucico/includes.h' -a "${1}" != "-c" ; then 
  2134.   echo shar: Will not clobber existing file \"'src/uucico/includes.h'\"
  2135. else
  2136. echo shar: Extracting \"'src/uucico/includes.h'\" \(2821 characters\)
  2137. sed "s/^X//" >'src/uucico/includes.h' <<'END_OF_FILE'
  2138. X/*
  2139. X * @(#)includes.h 1.2 87/08/14 -- Copyright 1987 by John Gilmore
  2140. X * Copying governed by GNU Emacs General Public License.
  2141. X *
  2142. X * Include files for various supported systems:
  2143. X * Note that NAMESIZE should be the max length of a file name, including
  2144. X * all its directories, drive specifiers, extensions, and the like.
  2145. X * E.g. on a Unix with 14-char file names, NAMESIZE is several hundred
  2146. X * characters, since the 14-char names can be nested.
  2147. X *
  2148. X * Ported to Amiga by William Loftus
  2149. X * Changes Copyright 1988 by William Loftus.  All rights reserved.
  2150. X */
  2151. X
  2152. X#ifdef BSD
  2153. X/* Unix Berserkeley systems */
  2154. X#include <stdio.h>
  2155. X#include <ctype.h>
  2156. X#include <sys/param.h>
  2157. X#include <sys/file.h>
  2158. X#include <sys/time.h>
  2159. X#include <string.h>
  2160. X
  2161. Xextern char *strtok();
  2162. X
  2163. X#define UNIX
  2164. X#define NAMESIZE    MAXPATHLEN
  2165. X#endif
  2166. X
  2167. X#ifdef SYSV
  2168. X/* Unix System V */
  2169. X#include <stdio.h>
  2170. X#include <ctype.h>
  2171. X#include <fcntl.h>
  2172. X#include <string.h>
  2173. X
  2174. X#define UNIX
  2175. X#endif
  2176. X
  2177. X#ifdef UNIX
  2178. X/* Stuff common to all Unix systems */
  2179. X#define remove    unlink    /* Unix-ism for removing a file */
  2180. X#define MULTITASK
  2181. X#define STDIN        0
  2182. X#define SPOOLDIR    "/usr/spool/uucp"
  2183. X#define PUBDIR        "/usr/spool/uucppublic"
  2184. X#define LOGFILE     "LOGFILE"
  2185. X#define O_BINARY    0    /* No distinction between text and binary */
  2186. X#endif
  2187. X
  2188. X#ifdef CPM
  2189. X/* CP/M-80 */
  2190. X#include <stdio.h>
  2191. X#include <ctype.h>
  2192. X#include <fcntl.h>
  2193. X
  2194. X#define NAMESIZE    50        /* No directories... */
  2195. X#endif
  2196. X
  2197. X#ifdef MSDOS
  2198. X/* Microsoft DOS */
  2199. X#include <stdio.h>
  2200. X#include <ctype.h>
  2201. X#include <fcntl.h>
  2202. X#include <time.h>
  2203. X#include <signal.h>
  2204. X#include <dos.h>
  2205. X#include <conio.h>
  2206. X#include <stdlib.h>
  2207. X#include <process.h>
  2208. X#include <string.h>
  2209. X#include <direct.h>
  2210. X#include <memory.h>
  2211. X
  2212. X/* Turn on support for the interrupt driven comm port routines */
  2213. X#define COMPORT
  2214. X
  2215. X#ifdef COMPORT
  2216. X#include "comport.h"
  2217. Xint handler();
  2218. X#endif
  2219. X
  2220. X#define GET_TIME 0x2c    /* DOS function number for get_time */
  2221. X#define DOS_INT  0x21    /* DOS interrupt number */
  2222. X
  2223. Xtypedef struct timetype {
  2224. X    unsigned hour;
  2225. X    unsigned minute;
  2226. X    unsigned sec;
  2227. X    unsigned hsec;
  2228. X} TIME, *TIME_PTR;
  2229. X
  2230. X
  2231. X/* FIXME, these should all be uppercase. */
  2232. X#define fnamesize    sizeof("FILENAME")    /* 8 chars */
  2233. X#define NAMESIZE    128        /* full path size */
  2234. X#define ufnamesize    5        /* uux id size */
  2235. X#endif
  2236. X
  2237. X#ifdef ST
  2238. X/* Atari ST */
  2239. X#include <stdio.h>
  2240. X#include <ctype.h>
  2241. X#include <osbind.h>
  2242. X#include <signal.h>
  2243. X
  2244. X#define O_RDONLY    0    /* for read only open() */
  2245. X#define AUX        1    /* rs232 port */
  2246. X#define CON        2    /* console */
  2247. X#define NAMESIZE    13    /* filename size */
  2248. X#define CTRL(X) (X & 037)
  2249. X
  2250. X#endif
  2251. X
  2252. X#ifdef AMIGA
  2253. X#include <exec/types.h>
  2254. X#include <fcntl.h>
  2255. X#include <exec/exec.h>
  2256. X#include <devices/serial.h>
  2257. X#include <devices/keymap.h>
  2258. X#include <devices/timer.h>
  2259. X#include <libraries/dos.h>
  2260. X#include <signal.h>
  2261. X#include <stdio.h>
  2262. X#include <stdlib.h>
  2263. X#include <string.h>
  2264. X#include <ctype.h>
  2265. X#include <time.h>
  2266. X#define NAMESIZE 128
  2267. X#endif
  2268. END_OF_FILE
  2269. if test 2821 -ne `wc -c <'src/uucico/includes.h'`; then
  2270.     echo shar: \"'src/uucico/includes.h'\" unpacked with wrong size!
  2271. fi
  2272. # end of 'src/uucico/includes.h'
  2273. fi
  2274. if test -f 'src/uucico/uuxqt.c' -a "${1}" != "-c" ; then 
  2275.   echo shar: Will not clobber existing file \"'src/uucico/uuxqt.c'\"
  2276. else
  2277. echo shar: Extracting \"'src/uucico/uuxqt.c'\" \(2378 characters\)
  2278. sed "s/^X//" >'src/uucico/uuxqt.c' <<'END_OF_FILE'
  2279. X
  2280. X/*
  2281. X *  UUXQT.C by William Loftus
  2282. X *  Copyright 1988 by William Loftus.    All rights reserved.
  2283. X *
  2284. X *  Beta Version 0.31
  2285. X *
  2286. X */
  2287. X
  2288. X#include <stdio.h>
  2289. X#include <string.h>
  2290. X#include "/version.h"
  2291. X
  2292. XIDENT(".01");
  2293. X
  2294. Xstatic char names[3000];
  2295. Xstatic char *pointers[300];
  2296. Xstatic int file_pointer;
  2297. Xstatic int error;
  2298. Xstatic char* xfile;
  2299. Xstatic char dfile[128];
  2300. Xstatic char cmd[1024];
  2301. Xstatic char ccmd[128];
  2302. Xstatic char ccmd_args[128];
  2303. Xstatic char buf[128];
  2304. Xstatic char path[128];
  2305. X
  2306. X#define DELIM " \t\n\r"
  2307. X
  2308. XCXBRK()
  2309. X{
  2310. X    return(0);
  2311. X}
  2312. X
  2313. Xchar *
  2314. Xwork_scan()
  2315. X{
  2316. X    static char name[128];
  2317. X    int count;
  2318. X
  2319. X    file_pointer = 0;
  2320. X
  2321. X    sprintf(name,"UUSPOOL:X.#?");
  2322. X
  2323. X    count = getfnl(name,names,sizeof(names),0);
  2324. X
  2325. X    if (count > 0) {
  2326. X    printf("New files have arrived.\n");
  2327. X
  2328. X    if (strbpl(pointers,300,names) != count) {
  2329. X        printf("Too many execute files\n");
  2330. X        return (char *)NULL;
  2331. X    }
  2332. X    } else {
  2333. X    return (char *)NULL;
  2334. X    }
  2335. X    return (char *)1;
  2336. X}
  2337. X
  2338. Xchar *
  2339. Xwork_next()
  2340. X{
  2341. X    return pointers[file_pointer++];
  2342. X}
  2343. X
  2344. Xparse(x)
  2345. Xchar *x;
  2346. X{
  2347. X    FILE *fp;
  2348. X    char *tmp;
  2349. X
  2350. X    fp = fopen(x, "r");
  2351. X    if (fp == (char *)NULL) {
  2352. X    printf("Can't open file %s\n",x);
  2353. X    chdir(path);
  2354. X    return(0);
  2355. X    }
  2356. X    while (fgets(buf, sizeof buf, fp)) {
  2357. X    if (strncmp(buf, "F", 1) == 0)
  2358. X        strcpy(dfile, strtok(&buf[1],DELIM));
  2359. X    else if (strncmp(buf, "C", 1) == 0)
  2360. X        strcpy(ccmd, strtok(&buf[1],DELIM));
  2361. X    strcpy(ccmd_args, strtok(NULL, DELIM));
  2362. X    while ((tmp = (char *)strtok(NULL, DELIM)) != NULL) {
  2363. X         strcat(ccmd_args, " ");
  2364. X         strcat(ccmd_args, tmp);
  2365. X    }
  2366. X    }
  2367. X
  2368. X    if (strncmp(ccmd, "rmail", 5) == 0) {
  2369. X    sprintf(cmd,"uucp:c/rmail < %s %s", dfile, ccmd_args);
  2370. X    } else if (strncmp(ccmd, "cunbatch", 5) == 0) {
  2371. X    sprintf(cmd,"uucp:c/cunbatch < %s %s", dfile, ccmd_args);
  2372. X    } else if (strncmp(ccmd, "rnews", 5) == 0) {
  2373. X    sprintf(cmd,"uucp:c/rnews < %s %s", dfile, "UseNet");
  2374. X    } else {
  2375. X    printf("Unknown command request %s  - Operation Aborted -\n", ccmd);
  2376. X    error = 1;
  2377. X    }
  2378. X    fclose(fp);
  2379. X    return(1);
  2380. X}
  2381. X
  2382. X
  2383. Xvoid
  2384. Xmain()
  2385. X{
  2386. X    getcwd(path,128);
  2387. X    chdir("UUSPOOL:");
  2388. X    if (work_scan() != (char *)NULL) {
  2389. X    while ((xfile = work_next()) != (char *)NULL) {
  2390. X        LockFile(xfile);
  2391. X        if (parse(xfile)) {
  2392. X        int syserr;
  2393. X        if (syserr = system(cmd + 7))
  2394. X            syserr = system(cmd);
  2395. X        if (syserr == 0 && error != 1) {
  2396. X            remove(xfile);
  2397. X            remove(dfile);
  2398. X        }
  2399. X        }
  2400. X        UnLockFile(xfile);
  2401. X    }
  2402. X    }
  2403. X    chdir(path);
  2404. X}
  2405. X
  2406. END_OF_FILE
  2407. if test 2378 -ne `wc -c <'src/uucico/uuxqt.c'`; then
  2408.     echo shar: \"'src/uucico/uuxqt.c'\" unpacked with wrong size!
  2409. fi
  2410. # end of 'src/uucico/uuxqt.c'
  2411. fi
  2412. echo shar: End of archive 3 \(of 16\).
  2413. cp /dev/null ark3isdone
  2414. MISSING=""
  2415. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ; do
  2416.     if test ! -f ark${I}isdone ; then
  2417.     MISSING="${MISSING} ${I}"
  2418.     fi
  2419. done
  2420. if test "${MISSING}" = "" ; then
  2421.     echo You have unpacked all 16 archives.
  2422.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2423. else
  2424.     echo You still need to unpack the following archives:
  2425.     echo "        " ${MISSING}
  2426. fi
  2427. ##  End of shell archive.
  2428. exit 0
  2429. -- 
  2430. Submissions to comp.sources.amiga and comp.binaries.amiga should be sent to:
  2431.     amiga@cs.odu.edu    
  2432. or    amiga@xanth.cs.odu.edu    ( obsolescent mailers may need this address )
  2433. or    ...!uunet!xanth!amiga    ( very obsolescent mailers need this address )
  2434.  
  2435. Comments, questions, and suggestions should be addressed to ``amiga-request''
  2436. (please only use ``amiga'' for actual submissions) at the above addresses.
  2437.